package entities.axiom;

import java.util.HashSet;
import java.util.Set;

import option.KBVocabulary;

import entities.KBEntity;
import entities.role.Role;

public class RoleInverseAxiom extends RoleAxiom {

	private final Role r, ir;
	
	public RoleInverseAxiom(Role r, Role ir){
		this.r = r;
		this.ir = ir;
	}
	
	public Role getLeftRole(){
		return this.r;
	}
	
	public Role getRightRole(){
		return this.ir;
	}
	
	@Override
	public Axiom getPrimeCopy() {
		return new RoleInverseAxiom(r.getPrimeCopy(), ir.getPrimeCopy());
	}
	
	@Override
	public String toString(){
		return "("+KBVocabulary.ROLE_INV+" "+r.toSerializedString()+" "
				+ir.toSerializedString()+")";
	}

	@Override 
	public Set<KBEntity> extractSig(){
		Set<KBEntity> sig = new HashSet<KBEntity>();
		sig.addAll(r.extractSig());
		sig.addAll(ir.extractSig());
		return sig;
	}

}
